package org.example.d2_collecion_traverse;

import java.util.ArrayList;
import java.util.Collection;

public class CollectionDemo02 {
    public static void main(String[] args) {
        Collection<String> c = new ArrayList<>();
        c.add("小红");
        c.add("花花");
        c.add("玫瑰");
        c.add("苏苏");
        System.out.println(c); //[小红, 花花, 玫瑰, 苏苏]
        for (String ele : c){
            System.out.println(ele);
        }


        String[] names = {"乐乐","欢欢","心心"};
        for (String name :names){
            System.out.println(names);
        }

    }
}
